--- ./setup.py.orig	2014-04-01 18:21:44.000000000 +0000
+++ ./setup.py	2014-04-26 18:30:44.000000000 +0000
@@ -369,9 +369,18 @@
                     feature.jpeg = "libjpeg"  # alternative name
 
         if feature.want('jpeg2000'):
-            if _find_include_file(self, "openjpeg-2.0/openjpeg.h"):
-                if _find_library_file(self, "openjp2"):
-                    feature.jpeg2000 = "openjp2"
+            if sys.platform.startswith("dragonfly") or sys.platform.startswith("freebsd"): 
+                # needs graphics/openjpeg > 1.5.x
+                if _find_include_file(self, "openjpeg.h"):
+                    if _find_library_file(self, "openjp2"):
+                        feature.jpeg2000 = "openjp2"
+                elif _find_include_file(self, "openjpeg-2.0/openjpeg.h"):
+                    if _find_library_file(self, "openjp2"):
+                        feature.jpeg2000 = "openjp2"
+            else:
+                if _find_include_file(self, "openjpeg-2.0/openjpeg.h"):
+                    if _find_library_file(self, "openjp2"):
+                        feature.jpeg2000 = "openjp2"
                     
         if feature.want('tiff'):
             if _find_library_file(self, "tiff"):
